<?php
declare (strict_types = 1);

namespace app\validate;

use think\Validate;

class Procount extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */
	protected $rule = [
		  'id' => 'require|number',
			'name' => 'require|between:1,25',
			'owned_user_id' => 'require|number',
			'url' => 'require',
			'token' => 'require',
		//	'switch' => 'require|number',
			'description' => 'max:500',
			'blacklist_province' => 'max:500',
			'blacklist_country' => 'max:500',
			'blacklist_city' => 'max:500',
			'blacklist_ip' => 'max:500',
	];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */
    protected $message = [
				'id.require' => '必须传递id值',
				'id.number' => 'id必须为数值',
				'name.require' => '请上传name',
				'name.between' => '名字长度为1-25',
				'owned_user_id.require' => '必须指定用户',
				'owned_user_id.number' => '所属账户id必须是数值',
				'token.require' => '请上传token值,',
				'description.max' =>  '描述的最大字符长度为500',
				'blacklist_province.max' => '省份禁推的最大字符长度为500',
				'blacklist_country.max' => '国家禁推的最大字符长度为500',
				'blacklist_city.max' => '城市禁推的最大字符长度为500',
				'blacklist_ip.max' => 'ip禁推的最大字符长度为500',
		];

		protected $scene=[
				'create' => [

				],

				'edit' => [

				],
		];
}
